<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.js"></script>
</head>
<body>
    密码必须由英文字母（区别大小写），数字和特殊符号组成，且
    长度在8-16之间
    // dfdf
    // 333333333dA#

    <input type="text" placeholder="密码" onblur="check()" />
    <span id="s1"></span>
    <script>
        function check(){
            var pwd = $("input:text").val();
            var len = pwd.length;
            var isLenRight = len>=8&&len<=16;

            var reg1 = /[a-z]+/;
            var isHaveSmallLetter = reg1.test(pwd);

            var reg2 = /[A-Z]+/;
            var isHaveBigLetter = reg2.test(pwd);

            var reg3 = /[0-9]+/i;
            var isHaveNumber = reg3.test(pwd);

            var reg4 = /[~!@#\$%\^\*\(\)_-]+/;
            var isHaveSpLetter = reg4.test(pwd);

            if(isLenRight&&isHaveSmallLetter
                &&isHaveBigLetter&&
                isHaveNumber&&isHaveSpLetter
            ){
                $("#s1").html("正确！");
            }else{
                $("#s1").html("错误！");
            }
        }
    </script>
</body>
</html>